package routers

import (
	"github.com/gin-gonic/gin"
	"netdisk/controller"
)

//设置路由，初始化服务器
func SetupRouter() *gin.Engine {
	gin.SetMode(gin.ReleaseMode)
	engine := gin.Default()
	//engine.GET("/", controller.IndexHandler)

	user_group := engine.Group("user")
	{
		user_group.GET("/register", controller.SendRegisterToken)
		user_group.POST("/register", controller.RegisterUser)
		user_group.POST("/avatar", controller.SetAvator)
		// 待办事项
		// 添加
		//v1Group.POST("/todo", controller.CreateTodo)
		//// 查看所有的待办事项
		//v1Group.GET("/todo", controller.GetTodoList)
		//// 修改某一个待办事项
		//v1Group.PUT("/todo/:id", controller.UpdateATodo)
		//// 删除某一个待办事项
		//v1Group.DELETE("/todo/:id", controller.DeleteATodo)
	}
	return engine
}
